﻿using System.Collections.Generic;
using Microsoft.Xna.Framework;

namespace BlockeyEssentials.ScreenSystem.ScreenTypes
{
    public class MenuScreen : Screen
    {
        public MenuScreen(ScreenManager oManager, string oTitle)
            : base(oManager)
        {
            _Title = oTitle;
            _Options = new List<string>();
            _Index = 0;
        }

        #region Methods

        protected void IndexUp()
        {
            IndexTo(_Index + 1);
        }

        protected void IndexDown()
        {
            IndexTo(_Index - 1);
        }

        protected virtual void IndexTo(int oIndex)
        {
            if (_Options.Count == 0)
                return;

            if (oIndex < 0)
                oIndex = 0;
            else if (oIndex > _Options.Count - 1)
                oIndex = _Options.Count - 1;

            _Index = oIndex;
        }

        protected virtual void Select()
        { }

        protected virtual void Cancel()
        { }

        #endregion

        protected string _Title;
        protected List<string> _Options;
        protected int _Index;

    }

}
